#include "HierarchyRoot.h"
#include <iostream>
using namespace std;
//*Two distinct reference counting interface
class RefCounted
{
public:
	virtual void IncRef() = 0;
	virtual bool DecRef() = 0;
	virtual ~RefCounted() {cout<<"RefCounted"<<endl;}
};

class Shape : private HierarchyRoot<Shape>, public RefCounted
{
public:
	using HierarchyRoot<Shape>::HierarchyId;
	void IncRef() {}
	bool DecRef() { cout<<"HierarchyRoot<Shape>::HierarchyId"<<endl; return true; }
};

class Rectangle : public Shape
{

};

class Widget : private HierarchyRoot<Widget>
{
public:
	using HierarchyRoot<Widget>::HierarchyId;
	void AddReference();
	int RemoveReference() { cout<<"HierarchyRoot<Widget>::HierarchyId"<<endl; return 0; };
};

